using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication11.Models.Mapping
{
    public class ComplicationMap : EntityTypeConfiguration<Complication>
    {
        public ComplicationMap()
        {
            // Primary Key
            this.HasKey(t => t.C_ID);

            // Properties
            this.Property(t => t.patient_id)
                .HasMaxLength(20);

            this.Property(t => t.create_by)
                .HasMaxLength(20);

            this.Property(t => t.C_Major_complications)
                .IsFixedLength()
                .HasMaxLength(10);

            this.Property(t => t.C_Complications_described)
                .HasMaxLength(100);

            this.Property(t => t.C_Emergency_revascularization)
                .HasMaxLength(100);

            this.Property(t => t.C_Sit_complications)
                .HasMaxLength(100);

            this.Property(t => t.C_Vessel_dissection)
                .HasMaxLength(100);

            this.Property(t => t.C_Hemodynamic_arrhythmia)
                .HasMaxLength(100);

            this.Property(t => t.C_Allergic_reactions)
                .HasMaxLength(100);

            this.Property(t => t.C_Intracoronary)
                .HasMaxLength(100);

            this.Property(t => t.C_Complication_Other)
                .HasMaxLength(100);

            this.Property(t => t.C_BlockMemo)
                .HasMaxLength(100);

            this.Property(t => t.C_IsShow)
                .IsFixedLength()
                .HasMaxLength(10);

            // Table & Column Mappings
            this.ToTable("Complication");
            this.Property(t => t.C_ID).HasColumnName("C_ID");
            this.Property(t => t.patient_id).HasColumnName("patient_id");
            this.Property(t => t.follow_up_id).HasColumnName("follow_up_id");
            this.Property(t => t.create_time).HasColumnName("create_time");
            this.Property(t => t.create_by).HasColumnName("create_by");
            this.Property(t => t.C_Major_complications).HasColumnName("C_Major_complications");
            this.Property(t => t.C_Complications_described).HasColumnName("C_Complications_described");
            this.Property(t => t.C_Emergency_revascularization).HasColumnName("C_Emergency_revascularization");
            this.Property(t => t.C_Sit_complications).HasColumnName("C_Sit_complications");
            this.Property(t => t.C_Vessel_dissection).HasColumnName("C_Vessel_dissection");
            this.Property(t => t.C_Hemodynamic_arrhythmia).HasColumnName("C_Hemodynamic_arrhythmia");
            this.Property(t => t.C_Allergic_reactions).HasColumnName("C_Allergic_reactions");
            this.Property(t => t.C_Intracoronary).HasColumnName("C_Intracoronary");
            this.Property(t => t.C_Complication_Other).HasColumnName("C_Complication_Other");
            this.Property(t => t.C_BlockMemo).HasColumnName("C_BlockMemo");
            this.Property(t => t.C_IsShow).HasColumnName("C_IsShow");
        }
    }
}
